home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming All in One / 3D Game Programming All in One Disc.iso / 3D2E / RESOURCES / KOOB / creator / editor / AIEFrameSetDlg.gui < prev    next >
Text File  |  2005-11-23  |  4KB  |  163 lines

  1. //--- OBJECT WRITE BEGIN ---
  2. new GuiControl(AIEFrameSetDlg) {
  3.     profile = "GuiModelessDialogProfile";
  4.     horizSizing = "right";
  5.     vertSizing = "bottom";
  6.     position = "0 0";
  7.     extent = "640 480";
  8.     minExtent = "8 8";
  9.     visible = "1";
  10.     helpTag = "0";
  11.         activeToolCount = "0";
  12.  
  13.     new GuiFrameSetCtrl(AIEFrameSet) {
  14.         profile = "GuiContentProfile";
  15.         horizSizing = "width";
  16.         vertSizing = "height";
  17.         position = "120 30";
  18.         extent = "520 420";
  19.         minExtent = "8 8";
  20.         visible = "1";
  21.         helpTag = "0";
  22.         columns = "0";
  23.         rows = "0";
  24.         borderWidth = "4";
  25.         borderColor = "206 206 206 206";
  26.         borderEnable = "dynamic";
  27.         borderMovable = "dynamic";
  28.         autoBalance = "0";
  29.  
  30.         new GuiControl(AIEFrame) {
  31.             profile = "GuiDefaultProfile";
  32.             horizSizing = "width";
  33.             vertSizing = "height";
  34.             position = "0 0";
  35.             extent = "520 420";
  36.             minExtent = "8 8";
  37.             visible = "1";
  38.             helpTag = "0";
  39.                 borderWidth = "2";
  40.  
  41.         };
  42.         new GuiFrameSetCtrl(AIEToolFrameSet) {
  43.             profile = "GuiContentProfile";
  44.             horizSizing = "width";
  45.             vertSizing = "height";
  46.             position = "520 420";
  47.             extent = "20 20";
  48.             minExtent = "8 8";
  49.             visible = "1";
  50.             helpTag = "0";
  51.             columns = "0";
  52.             borderWidth = "3";
  53.             borderColor = "206 206 206 206";
  54.             borderEnable = "dynamic";
  55.             borderMovable = "dynamic";
  56.             autoBalance = "0";
  57.         };
  58.     };
  59. };
  60. //--- OBJECT WRITE END ---
  61.  
  62. //------------------------------------------------------------------------------
  63. // Functions
  64. //------------------------------------------------------------------------------
  65.  
  66. function AIEFrameSetDlg::getPrefs(%this)
  67. {
  68. }
  69.  
  70. function AIEFrameSetDlg::setPrefs(%this)
  71. {
  72. }
  73.  
  74. function AIEFrameSetDlg::onWake(%this)
  75. {
  76.    $AIEdit = true;
  77.    AIEditorMap.push();
  78.    aiEdit.clearIgnoreList();
  79.    aiEdit.ignoreObjClass(AIObjective);
  80.    aiEdit.toggleIgnoreList = true;
  81.    aiEdit.renderNav = true;
  82. }
  83.  
  84. function AIEFrameSetDlg::onSleep(%this)
  85. {
  86.    $AIEdit = false;
  87.    AIEditorMap.pop();
  88.    EditorTree.open("MissionGroup");
  89. }
  90.  
  91. function AIEFrameSetDlg::init(%this)
  92. {
  93.    AIEFrame.add(aiEdit);
  94.    %this.resetFrames();
  95. }
  96.  
  97. function AIEFrameSetDlg::update(%this)
  98. {
  99.    // check the frame to see if it is visible
  100.    if(AIEToolFrameSet.getCount())
  101.    {
  102.       %res = getResolution();
  103.  
  104.       //90 = width of button bar
  105.       %width = getWord(%res, 0) - 90;
  106.  
  107.       if(AIEFrameSet.getColumnOffset(1) > %width - editor.minToolFrameWidth)
  108.          AIEFrameSet.setColumnOffset(1, %width - editor.minToolFrameWidth);
  109.    }
  110. }
  111.  
  112. function AIEFrameSetDlg::resetFrames(%this)
  113. {
  114.    %tools = AIEToolFrameSet;
  115.    while(%tools.getRowCount() > %tools.getCount())
  116.       %tools.removeRow();
  117.    while(%tools.getRowCount() < %tools.getCount())
  118.       %tools.addRow();
  119.       
  120.    %offset = 400;
  121.  
  122.    // update the frame view
  123.    %frameSet = AIEFrameSet;
  124.    if(!%tools.getCount() && (%frameSet.getColumnCount() > 1))
  125.    {
  126.       %Offset = %frameSet.getColumnOffset(1);
  127.       %frameSet.removeColumn();
  128.    }
  129.    if(%tools.getCount() && (%frameSet.getColumnCount() == 1))
  130.    {
  131.       %frameSet.addColumn();
  132.       %frameSet.setColumnOffset(1, %offset);
  133.    }
  134.  
  135.    //if(%tools.getCount())
  136.       //%this.toolPaneOffset = AIEFrameSet.getColumnOffset(1);
  137.    %this.activeToolCount = %tools.getCount();
  138. }
  139.  
  140. function AIEFrameSetDlg::addTool(%this, %tool)
  141. {
  142.    %group = nameToId("MissionGroup/Teams/team" @ $AIEditor::inspectTeam @ "/AIObjectives");
  143.    
  144.    if(%group == -1)
  145.       return false;
  146.    
  147.    if($AIEditor::inspectTeam == 1)
  148.       EditorTree.open("MissionGroup/Teams/team1/AIObjectives");
  149.    else
  150.       EditorTree.open("MissionGroup/Teams/team2/AIObjectives");
  151.    
  152.    AIEToolFrameSet.add(%tool);
  153.    %this.resetFrames();
  154.    return true;
  155. }
  156.  
  157. function AIEFrameSetDlg::removeTool(%this, %tool)
  158. {
  159.    AIEToolFrameSet.remove(%tool);
  160.    %this.resetFrames();
  161. }
  162.  
  163.